<HTML><HEAD><TITLE>fzn_last(+FznState)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(flatzinc)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>fzn_last(+FznState)</H1>
Increments solutions count, and succeeds if last one reached
<DL>
<DT><EM>FznState</EM></DT>
<DD>a FlatZinc state descriptor
</DD>
</DL>
<H2>Description</H2>
<P>
	Assuming a model has previously been loaded successfully
	using fzn_load_xxx or mzn_load_xxx, this primitive can be used
	to limit the number of solutions produced.  It increments a
	nonlogical counter and fails as long as the number of solutions
	that were requested in the zn_options has not yet been reached.
    </P>
<H3>Modes and Determinism</H3><UL>
<LI>fzn_last(+) is semidet
</UL>
<H3>Fail Conditions</H3>
Fails if not enough solutions found yet
<H2>Examples</H2>
<PRE>
    my_fzn_run_stream(ModelStream, Options) :-
	fzn_init(Options, State),
	fzn_load_stream(ModelStream, State),
	fzn_search(State),
	fzn_output(State),
	fzn_last(State),
	!.
    </PRE>
<H2>See Also</H2>
<A HREF="../../lib_public/flatzinc/zn_options-s.html">struct(zn_options)</A>, <A HREF="../../lib_public/flatzinc/fzn_init-2.html">fzn_init / 2</A>, <A HREF="../../lib_public/flatzinc/fzn_search-1.html">fzn_search / 1</A>
</BODY></HTML>
